import api from '../index'
import urls from './urls'
const header = {
  'Content-Type': 'application/json; charset=utf-8'
}
const headers = {
  'Content-Type': 'application/x-www-form-urlencoded'
}
export default {
  // 角色管理
  getRole(params) {
    return api.get(urls.getRole, params)
  },
  addRole(params) {
    return api.post(urls.addRole, params, header)
  },
  editRole(params) {
    return api.put(urls.editRole, params)
  },
  removeRole(params) {
    return api.delete(urls.removeRole, params)
  },
  // 角色权限分配
  getseleRole(params) {
    return api.get(urls.roleselect, params)
  },
  getRoleMenu(params){
    return api.get(urls.getRoleMenu,params)
  },
  setRoleMenu(params){
    return api.post(urls.setRoleMenu,params,header)
  },
  // 用户组信息
  getUsergroup(params) {
    return api.get(urls.getUsergroup, params)
  },
  addUsergroup(params) {
    return api.post(urls.addUsergroup, params, header)
  },
  editUsergroup(params) {
    return api.put(urls.editUsergroup, params)
  },
  removeUsergroup(params) {
    return api.delete(urls.removeUsergroup, params)
  },
  getseleUsergroup(params) {
    return api.get(urls.usergroupselect, params)
  },
  //用户信息
  addUser(params) {
    return api.post(urls.addUser, params, header)
  },
  getUserinfo(params) {
    return api.get(urls.getUserinfo, params)
  },
  editUsers(params) {
    return api.put(urls.editUsers, params)
  },
  removeUserinfo(params) {
    return api.delete(urls.removeUserinfo, params)
  },
  //个人中心
  rpwd(params){
    return api.delete(urls.rpwd,params,header)
  },
  getUser(params) {
    return api.get(urls.getUser, params)
  },
  editUser(params) {
    return api.put(urls.editUser, params)
  },
  editUpwd(params) {
    return api.delete(urls.editUpwd, params)
  },
  //用户权限分配
  getseleuser(params) {
    return api.get(urls.getseleuser, params)
  },
  getuab(params) {
    return api.get(urls.getuab, params)
  },
  setuab(params){
    return api.post(urls.setuab,params,header)
  },
  //菜单管理
  getMenu(params) {
    return api.get(urls.getMenu, params)
  },
  addMenu(params) {
    return api.post(urls.addMenu, params, header)
  },
  editMenu(params) {
    return api.put(urls.editMenu, params)
  },
  removeMenu(params) {
    return api.delete(urls.removeMenu, params)
  },
  menuSelect(params) {
    return api.get(urls.menuselect, params)
  },
  //操作日志
  getLog(params) {
    return api.get(urls.getLog, params)
  },
  //钻井日报
  getWellDaily(params) {
    return api.get(urls.getWellDaily, params)
  },
  removeWellDaily(params) {
    return api.delete(urls.removeWellDaily, params)
  },
  previewWellDaily(params){
    return api.get(urls.previewWellDaily, params)
  },
  //地质日报
  getGeologicalDaily(params) {
    return api.get(urls.getGeologicalDaily, params)
  },
  removeGeologicalDaily(params) {
    return api.delete(urls.removeGeologicalDaily, params)
  },
  previewGeologicalDaily(params) {
    return api.get(urls.previewGeologicalDaily, params)
  },
  //泥浆日报
  getSlurryDaily(params) {
    return api.get(urls.getSlurryDaily, params)
  },
  removeSlurryDaily(params) {
    return api.delete(urls.removeSlurryDaily, params)
  },
  previewSlurryDaily(params) {
    return api.get(urls.previewSlurryDaily, params)
  },
  //数据导出
  getmodel() {
    return api.get(urls.getmodel)
  },
  showwitsname(params) {
    return api.get(urls.showwitsname, params)
  },
  showcanshu(params) {
    return api.get(urls.showcanshu, params)
  },
  savexml(params) {
    return api.post(urls.savexml, params, header)
  },
  putxml(params) {
    return api.put(urls.putxml, params)
  },
  getxml(params) {
    return api.get(urls.getxml, params)
  },
  delexml(params) {
    return api.delete(urls.delexml, params)
  },
  showdata(params) {
    return api.get(urls.showdata, params)
  },
  getshiqu(params) {
    return api.get(urls.getshiqu, params)
  },
  exportfile(params) {
    return api.gets(urls.exportfile, params, headers)
  },
}